Skip to content

Revise results pretty-printing#143

Merged
FObersteiner merged 15 commits into
mainfrom
revise-prettyprinting
Mar 23, 2026
Merged

Revise results pretty-printing#143
FObersteiner merged 15 commits into
mainfrom
revise-prettyprinting

Conversation

@FObersteiner

@FObersteiner FObersteiner commented Mar 4, 2026

Copy link
Copy Markdown
Collaborator
  • 'D' for integer nanoseconds to duration is gone from Zig master
  • std.Io.Duration has a formatter method, but that does not support alignment + padding (yet)

I re-built padding + alignment as it is done for other types in std. And since I was at it, I added dynamic adjustment of the pretty printing to the name length of the benchmarks. Overall there might be a more elegant solution but at least it makes the output a bit more flexible.

Resolves #130 - although it is not exactly configurable...

@FObersteiner

Copy link
Copy Markdown
Collaborator Author

dynamic sizing in action:

❯ zig build examples && ./zig-out/bin/shuffling_allocator
benchmark                            runs     total time     time/run (avg ± σ)    (min ... max)                p75        p99        p995      
-------------------------------------------------------------------------------------------------------------------------------------------------
My Benchmark 1                       64       3.69s          57.668ms ± 16.766ms   (26.449ms ... 93.597ms)      70.557ms   93.597ms   93.597ms   
My Benchmark 2 (tracking)            64       3.483s         54.43ms ± 16.342ms    (28.76ms ... 91.848ms)       65.804ms   91.848ms   91.848ms   
My Benchmark 2 (tracking) [MEMORY]                           512B ± 0B             (512B ... 512B)              512B       512B       512B      
My Benchmark 3 (shuffling)           64       4.151s         64.864ms ± 16.543ms   (33.672ms ... 107.314ms)     74.66ms    107.314ms  107.314ms  
My Benchmark 4 (shuffling + track)   64       3.775s         58.995ms ± 19.485ms   (31.037ms ... 114.873ms)     68.632ms   114.873ms  114.873ms  
My Benchmark 4 (shuffling + track) [MEMORY]                  512B ± 0B             (512B ... 512B)              512B       512B       512B      

zBench on  revise-prettyprinting [!] via ↯ v0.16.0-dev.2694+74f361a5c took 16s 
❯ zig build examples && ./zig-out/bin/basic
benchmark      runs     total time     time/run (avg ± σ)    (min ... max)                p75        p99        p995      
---------------------------------------------------------------------------------------------------------------------------
My Benchmark   229      2.017s         8.808ms ± 3.216ms     (3.162ms ... 15.862ms)       11.16ms    15.824ms   15.842ms   

zBench on  revise-prettyprinting [!] via ↯ v0.16.0-dev.2694+74f361a5c took 4s 
❯ zig build examples && ./zig-out/bin/sleep
benchmark         runs     total time     time/run (avg ± σ)    (min ... max)                p75        p99        p995      
------------------------------------------------------------------------------------------------------------------------------
Sleep Benchmark   19       1.901s         100.091ms ± 8.106us   (100.084ms ... 100.118ms)    100.094ms  100.118ms  100.118ms 

@FObersteiner FObersteiner marked this pull request as ready for review March 5, 2026 17:10
@FObersteiner

Copy link
Copy Markdown
Collaborator Author

@hendriknielaender after some minor modification, this code still works with the latest Zig-master, do you think we should merge it?

I noted a new issue with the shuffling allocator example and updated #141 accordingly.

@hendriknielaender hendriknielaender left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool stuff 👍 yeah totally agree here. Lets merge this one.
@FObersteiner can you open seperate issues for it (e.g. the failing test for the shuffling allocator.)

@FObersteiner

Copy link
Copy Markdown
Collaborator Author

Cool stuff 👍 yeah totally agree here. Lets merge this one. @FObersteiner can you open seperate issues for it (e.g. the failing test for the shuffling allocator.)

OK I have made bug report issues for the examples that currently fail. Memory tracking seems to work fine in principle; I made a small change to the example file to clarify what should be expected here.

@FObersteiner FObersteiner merged commit eacf6f5 into main Mar 23, 2026
5 checks passed
@hendriknielaender hendriknielaender deleted the revise-prettyprinting branch March 24, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can we make the printed benchmark name length configurable?

2 participants